<?php
/**
 * Model providing vendor-specific implementation of SQLTable. Needs to be extended by a class implementing an individual table your application uses.
 */
abstract class MySQLTable extends SQLTable {
	/**
	 * (non-PHPdoc)
	 * @see SQLTable::describe()
	 */
	public function describe() {
		$objQuery = new MySQLTableQuery($this->strDatabaseName, $this->strTableName);
		return SQLResults::toList($this->server->executeStatement($objQuery->describe()));
	}	

	/**
	 * (non-PHPdoc)
	 * @see SQLTable::rename()
	 */
	public function rename($strNewTableName) {
		$objQuery = new MySQLTableQuery($this->strDatabaseName, $this->strTableName);
		$this->server->executeStatement($objQuery->rename($strNewTableName));
	}
	
	/**
	 * (non-PHPdoc)
	 * @see SQLTable::truncate()
	 */
	public function truncate() {
		$objQuery = new MySQLTableQuery($this->strDatabaseName, $this->strTableName);
		$this->server->executeStatement($objQuery->truncate());
	}
	
	/**
	 * (non-PHPdoc)
	 * @see SQLTable::drop()
	 */
	public function drop() {
		$objQuery = new MySQLTableQuery($this->strDatabaseName, $this->strTableName);
		$this->server->executeStatement($objQuery->drop());
	}
}